<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>SPHinXsys: &lt;img src=&quot;logo.png&quot; alt=&quot;&quot;/&gt; SPHinXsys Refactoring</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="logo.png"/></td>
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">SPHinXsys
   &#160;<span id="projectnumber">alpha version</span>
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'Search');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','Search');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

</div><!-- top -->
<div class="PageDoc"><div class="header">
  <div class="headertitle">
<div class="title"><img src="logo.png" alt="" class="inline"/> SPHinXsys Refactoring </div>  </div>
</div><!--header-->
<div class="contents">
<div class="textblock"><h1>List of smells</h1>
<ol type="1">
<li>it seems that there is a bug for reading stl file (the file name issue?) when using debug mode in windows</li>
<li>Introduce boundary condition or constraints which go together with particle dynamics algorithms. In this way, user will not forget the boundary condition or constraints during time stepping?</li>
<li>naming issues: used base key (like base_particles_) in name when it really means base class objects, if virtual function overriding is expected, do not use it (like use particles_)</li>
<li>closest point on surface for 3d geometries with binary operations</li>
<li>using more meaningful names for class members, so that I do not need extra comments</li>
<li>xml memory leaking (tried second time. Failed. Erasing XML elements will not decrease the memory usage.)</li>
<li>user may forget impose constraint when apply an algorithm modifying velocity field</li>
<li>temporary and one time output, such as for level set, may open a temporary folder without related to system. <br  />
</li>
</ol>
<h1>General principles on reviewing the code</h1>
<p>SPHinXsys should be reviewed often to increase its quality continuously. The target is to achieve a good layout which arranges the corresponding classes, variables, functions, algorithms, methods and physics in reasonable way. Generally, there are several criteria, i.e. formality, locality, additivity, simplicity and consistency, to qualify the layout of a code. <br  />
</p>
<h2>Formality</h2>
<p>As a C++ code, we would like to follow <a href="https://google.github.io/styleguide/cppguide.html">Google C++ Style Guide</a>.</p>
<h2>Locality</h2>
<p>First, locality requires that the data to operated should be as close to each other as possible. Second, it requires that conceptionally related variables and methods should be located close to each other.</p>
<h2>Additivity</h2>
<p>When a new feature is added, the original functionality should be maintained in general. This may requires modification of the original code. However, such modification should not change the interface by which the original functions are called, except that the interface will also be updated.</p>
<h2>Simplicity</h2>
<p>Less lines of code in a user case indicates easier application of SPHinXsys. A design will be more attractive if it can also avoid mistakes when a user case is set up. There are several ways to increase the simplicity. One is to define several relevant parts once for all.</p>
<h2>Consistency</h2>
<p>Consistency is very important. There are many aspects of consistency. The name of variable, function or class should be meaningful and consistent with its functionality. The comment should be consistent with the actual usage of the corresponding entry.</p>
<h1>Narrative coding</h1>
<p>One idea is writing a code in narrative style, just like to write a story. Since the code is quite complex, so it is like a complex story (may be a computer game?) with many stroy lines.</p>
<h1>Error-driving optimization</h1>
<p>After an error in an application or the library is reported, when we try to correct the error, we need to think what is possible reason that the error occurs, and try to optimize the code for avoiding in future similar errors.</p>
<h1>User-experience emphasis</h1>
<p>When we need choose between small performance gain and code tolerance for less strict coding style and better user experience, we more likely choose for the latter. </p>
</div></div><!-- contents -->
</div><!-- PageDoc -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by &#160;<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/>
</a> 1.8.17
</small></address>
</body>
</html>
